/*
 * Copyright (c) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef MSDP_COMMUNICATE_ADAPTER_H
#define MSDP_COMMUNICATE_ADAPTER_H

#include "icommunicate_interface.h"
#include "spatial_softbus_session.h"
#include "softbus_session_listener.h"

namespace OHOS {
namespace Msdp {
class CommunicateInterface : public ICommunicateInterface {
public:
    CommunicateInterface() = default;
    virtual ~CommunicateInterface() = default;

    virtual void RegisterListoner(const std::shared_ptr<RemoteListener>& remoteListener) override;
    virtual int PublishService() override;
    virtual int StartDiscovery() override;
    virtual int StopDiscovery() override;
    virtual int GetTrustDeviceList() override;
    virtual DeviceInfo GetLocalDeviceInfo() override;
    virtual int Connect(const DeviceInfo& device) override;
    virtual int Disconnect() override;
    virtual int RegisterDevStateCallback() override;
    virtual int UnRegisterDevStateCallback() override;
    virtual int CreateSessionServer() override;
    virtual int RemoveSessionServer() override;
    virtual int OpenSession(const std::string &peerDeviceId, int &sessionId) override;
    virtual int CloseSession(int32_t sessionId) override;
    virtual int SendBytes(int sessionId, const void *data, unsigned int len) override;
    virtual int SendMessage(int sessionId, const void *data, unsigned int len) override;
    virtual bool IsServer(int32_t sessionId) override;
    virtual int GetPeerDeviceId(int sessionId, std::string &peerDeviceId) override;
private:
    std::shared_ptr<RemoteListener> remoteListener_;
    std::vector<DeviceInfo> remoteDeviceInfoList_;
};
} // namespace Msdp
} // namespace OHOS

#endif // MSDP_ICOMMUNICATE_ADAPTER_H